﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common
{
   public class Departments
    {
       //Код другий
       public int ID { get; set; }
       //Назва кода першого
       public string NameOrigin { get; set; }
       //Код перший
       public string CodeOrigin { get; set; }
       //Назва кода другого
       public string NameCode { get; set; }
       //Номер за класифыкатором
       public string NumberClass { get; set; }
       //Абревіатура
       public string Abreviation { get; set; }
       //Відносяться до підприємства
       public string Enterprise { get; set; }
       //
       public string Adress { get; set; }

       public Dictionary<string, string> EnterpriseFields { get; private set; }
       public Dictionary<string, string> DepartmentsFields { get; private set; }
       public Dictionary<string, string> AdressFields { get; private set; }

       Departments() { }
       Departments(string nameOrigin, string codeOrigin, string nameCode, string numberClass, string abreviation, string enterprise, string adress)
           :this(0, nameOrigin, codeOrigin, nameCode, numberClass, abreviation, enterprise, adress){}
       Departments(int id, string nameOrigin, string codeOrigin, string nameCode, string numberClass, string abreviation, string enterprise, string adress)
       {
           this.ID = id;
           this.NameOrigin = nameOrigin;
           this.CodeOrigin = codeOrigin;
           this.NameCode = nameCode;
           this.NumberClass = numberClass;
           this.Abreviation = abreviation;
           this.Enterprise = enterprise;
           this.Adress = adress;

           AdressFields = new Dictionary<string, string>(1);
           AdressFields.Add("Adress", Adress);

           EnterpriseFields = new Dictionary<string, string>(1);
           EnterpriseFields.Add("NameCode", NameCode);

           DepartmentsFields = new Dictionary<string, string>(4);
           DepartmentsFields.Add("NameOrigin", NameOrigin);
           DepartmentsFields.Add("CodeOrigin", CodeOrigin);
           DepartmentsFields.Add("NameCode", NameCode);
           DepartmentsFields.Add("Abreviation", Abreviation);
       }

    }
}
